package com.g2room.driving.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.g2room.driving.mapper.ArticleMapper;
import com.g2room.driving.model.po.Article;

@Service
public class ArticleService {
	@Autowired
	private ArticleMapper articleMapper;
	
	/**
	 * 根据id获取数据
	 * @param id
	 * @return
	 */
	public Article getById(Integer id) {
		return articleMapper.getById(id);
	}
	
	/**
	 * 查询所有数据
	 * @return
	 */
	public List<Article> getAll() {
		return articleMapper.getAll();
	}
//	
//	/**
//	 * 获取驾驶技术和安全驾驶子类别下前5条数据
//	 * @return
//	 */
//	public List<Article> getTop5Type(Article article, Map<String, Object> pp) {
//		return articleMapper.getTop5Type(article, pp);
//	}
//
//	/**
//	 * 根据ID集合批量更新文章状态
//	 * @param state	文章状态：1、正常；2、隐藏；3、删除；4、已生成
//	 * @param ids
//	 * @return
//	 */
//	public void updateStateByIds(Integer state, String ids) {
//		articleMapper.updateStateByIds(state, ids);
//	}
}
